#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
using namespace std;
int fa[105], n;
struct node //存贮第一次输入的坐标，一定要是浮点型的
{
    double x, y;
} c[105];
struct node1 //存贮两个小岛的编号和小岛的距离
{
    int a, b;
    double l;
} eg[10005];
bool cmp(node1 x, node1 y) //比较函数
{
    return x.l < y.l;
}
int find(int x) //查找根并且缩短路径
{
    if (fa[x] != x)
        fa[x] = find(fa[x]);
    return fa[x];
}
void init() //初始化
{
    for (int i = 0; i < n; i++)
        fa[i] = i;
}
int main()
{
    int ncase;
    scanf("%d", &ncase);
    while (ncase--)
    {
        scanf("%d", &n);
        init();
        memset(&c, 0, sizeof(&c));
        memset(&eg, 0, sizeof(&eg));
        for (int i = 0; i < n; i++)
            scanf("%lf %lf", &c[i].x, &c[i].y);
        int k = 0;
        for (int i = 0; i < n; i++)
            for (int j = i + 1; j < n; j++)
            {
                double temp = sqrt(pow(c[i].x - c[j].x, 2) + pow(c[i].y - c[j].y, 2));
                if (temp >= 10 && temp <= 1000) //如果距离大于等于10小于等于1000
                {
                    eg[k].a = i, eg[k].b = j, eg[k].l = temp;
                    k++;
                }
            }
        sort(eg, eg + k, cmp); //根据距离排序<span style="white-space:pre">	</span>
        double sum = 0;        //计算最小生成树的和
        for (int i = 0; i < k; i++)
        {
            int x = find(eg[i].a);
            int y = find(eg[i].b);
            if (x != y)
                fa[x] = y, sum += eg[i].l;
        }
        int count = 0;
        for (int i = 0; i < n; i++) //判断树根个数
            if (fa[i] == i)
                count++;
        if (count != 1)
            printf("oh!\n");
        else
            printf("%.1lf\n", sum * 100);
    }
    return 0;
}
// https: //blog.csdn.net/su20145104009/article/details/47008921